﻿CREATE TABLE [dbo].[GamingSessionPlayerObjective]
(
	[GamingSessionPlayerObjectiveId] INT NOT NULL identity(1,1),
	[GamingSessionPlayerId] int not null,
	[BoardGameObjectiveId] int not null,
	[Value] int NOT null,
	[CreatedBy] NVARCHAR(256) NOT NULL, 
	[CreateDate] DATETIME NOT NULL, 
	[ModifiedBy] NVARCHAR(256) NOT NULL, 
	[ModifyDate] DATETIME NOT NULL, 
	constraint PK_GamingSessionPlayerObjective primary key ([GamingSessionPlayerObjectiveId]),
	constraint FK_GamingSessionPlayerObjective_IsOf_GamingSessionPlayer foreign key ([GamingSessionPlayerId])
		references GamingSessionPlayer ([GamingSessionPlayerId]),
	constraint FK_GamingSessionPlayerObjective_IsOf_BoardGameObjective foreign key ([BoardGameObjectiveId])
		references BoardGameObjective ([BoardGameObjectiveId])
)
go
create unique index UX_GamingSessionPlayerObjective_GamingSessionPlayerId_BoardGameObjectiveId on GamingSessionPlayerObjective ([GamingSessionPlayerId],[BoardGameObjectiveId])
go
create index IX_GamingSessionPlayerObjective_GamingSessionPlayerId on GamingSessionPlayerObjective ([GamingSessionPlayerId])
go
create index IX_GamingSessionPlayerObjective_BoardGameObjectiveId on GamingSessionPlayerObjective ([BoardGameObjectiveId])
go
